<?php
class Admin_IndexController extends Zendvn_Controller_Action{
	
	public function init(){
		$template_path= TEMPLATE_PATH. '/admin/system';
		$this->loadTemplate($template_path);
		
	}
	
	public function indexAction(){
		$log= new Zend_Session_Namespace('check');
		$this->view->check= $log->check;
		
		//lay du lieu nguoi dang nhap
		$auth=  Zend_Auth::getInstance();
		$info= $auth->getIdentity();
		if ($log->check){
			$this->view->name= $info->username;
		}
		
		$sql= new Admin_Model_IndexModel();
		
		// $new, $top o day
	}
	//danh muc sach ki thuat
	public function kithuatAction(){
		$this->view->title= "Sách Kĩ Thuật";
		// ket noi model
		$sql = new Admin_Model_IndexModel();
		$this->view->kithuat = $sql->showproduct('idcatelog', '1');
	}
	
	//danh muc sach kinh te
	public function kinhteAction(){
		$this->view-> title= "Sách Kinh Tế";
		$sql= new Admin_Model_IndexModel();
		$this->view->kinhte = $sql->showproduct('idcatelog', '2');
	}
	//danh muc sach khoa hoc
	public function khoahocAction(){
		
		$sql= new Admin_Model_IndexModel();
		$this->view->khoahoc= $sql ->showproduct('idcatelog', '3');
		
	}
	//danhmuc sach ngoai ngu
	public function ngoainguAction(){
		$sql= new Admin_Model_IndexModel();
		$this->view->ngoaingu= $sql->showproduct('idcatelog', '4');
	}
}